home *** CD-ROM | disk | FTP | other *** search
- include ccsdef.h
-
- public keybd, dfkey, shkey, msuinit
-
- ; some definitions
- kbint equ 16h ; IBM, Bios keyboard interrupt
- shift equ 200h ; IBM, synonym for right or left shift
- control equ 400h ; IBM, synonym for control shift
- alt equ 800h ; IBM, synonym for alt shift
- enhanced equ 1000h ; IBM, enhanced keyboard code
-
- rgt_shift equ 1 ; IBM shift state bits
- lft_shift equ 2
- ctl_shift equ 4
- alt_shift equ 8
- numlock equ 20h
-
- maxkeys equ 200 ; maximum number of key definitions
- maxstng equ 100 ; maximum number of multi-char strings
- stbuflen equ 1000 ; length of string buffer (bytes)
-
- verb equ 8000h ; dirlist flag: use verb action table
- strng equ 4000h ; dirlist flag: use string action table
- scan equ 100h ; keycode flag: code is scan not ascii
- braceop equ 7bh ; opening curly brace
- bracecl equ 7dh ; closing curly brace
-
- datas segment public 'datas'
- extrn taklev:byte, comand:byte, intake:byte, flags:byte
- extrn shkadr:word, stkadr:word, trans:byte
- ; system dependent references
- extrn vtemu:byte ; emulator data [jrd]
- extrn isccdos:byte ; MSDOS or CCDOS ? [zqf]
-
- ;;; System Independent local storage
-
- tranbuf db 132 dup (?) ; 132 byte translator work buffer
- crlf db cr,lf,'$'
- dfhelp1 db cr,lf,' Enter key',27h,'s identification as a character',cr,lf
- db ' or as its numerical equivalent \{b##} of ascii',cr,lf
- db ' or as its scan code \{b##}'
- db cr,lf,' or as SCAN followed by its scan code',cr,lf
- db ' where b is O for octal, X for hex, or D for decimal'
- db ' (default).',cr,lf,' Braces {} are optional.'
- db cr,lf,' Follow the identification with the new definition.'
- db cr,lf,' or CLEAR to restore initial key settings'
- db cr,lf,' or ON (def) for Bios i/o or OFF to use DOS i/o.$' ;IBM
- cdfhelp1 db cr,lf,'╩Σ╚δ╝ⁿ',27h,'╡─╫╓╖√▒Ω╩╢',cr,lf
- db ' ╗≥╩╟╦ⁿ╡╚╝█╡─ ascii ╓╡: \{b##}',cr,lf
- db ' ╗≥╩╟╦ⁿ╡─╔¿├Φ┬δ: \{b##}'
- db cr,lf,' ╗≥╩╟ SCAN ║≤╜╙╦ⁿ╡─╔¿├Φ┬δ',cr,lf
- db ' ╒Γ└∩ b┐╔╥╘╩╟ O, X ╗≥ D,╖╓▒≡▒φ╩╛░╦╜°╓╞.╩«┴∙╜°╓╞║═╩«╜°╓╞╩²'
- db '╚▒╩í╘≥▒φ╩╛╩╟╩«╜°╓╞╩²',cr,lf,' { }╩╟╚╬╤í╧ε.'
- db cr,lf,' ▒Ω╩╢╖√║≤╜╙╨┬╡─╢¿╥σ.'
- db cr,lf,' ╗≥╩╟ CLEAR ╗╓╕┤╫ε│⌡╡─╝ⁿ╔Φ╓├'
- db cr,lf,' ╗≥╩╟ ON -- ╞⌠╢» BIOS ╡─ I/O (╚▒╩í)'
- db '╗≥ OFF -- ╩╣╙├ DOS ╡─ I/O.$'
- dfaskky db cr,lf,' Push key to be defined: $'
- cdfaskky db cr,lf,' ╩Σ╚δ╨Φ╥¬╢¿╥σ╡─╝ⁿ: $'
- dfaskdf db ' Enter new definition: $'
- cdfaskdf db ' ╩Σ╚δ╨┬╡─╢¿╥σ: $'
- verbbad db cr,lf,' No such verb',cr,lf,'$'
- cverbbad db cr,lf,' ├╗╙╨╒Γ╤∙╡─╢»╫≈',cr,lf,'$'
- strbad db cr,lf,' Not enough space for new string',cr,lf,'$'
- cstrbad db cr,lf,' ├╗╙╨╫π╣╗╡─┐╒╝Σ╠ß╣⌐╕°╨┬╡─╫╓╖√┤«',cr,lf,'$'
- keyfull db cr,lf,' No more space to define keys',cr,lf,'$'
- ckeyfull db cr,lf,' ├╗╙╨╕ⁿ╢α╡─┐╒╝Σ╢¿╥σ╝ⁿ',cr,lf,'$'
- dfkopps db cr,lf,' Opps! That is Kermit',27h,'s Escape Char.'
- db ' Translation is not permitted.',cr,lf,'$'
- cdfkopps db cr,lf,' ▓╗╢╘! ─╟╩╟ Kermit ╧╡═│',27h,'╡─═╦│÷╫╓╖√.'
- db ' ╩╟▓╗╘╩╨φ╫¬╗╗╡─.',cr,lf,'$'
- shkmsg1 db cr,lf,'Push key to be shown (? shows all): $'
- cshkmsg1 db cr,lf,'╧╘╩╛╥╤╢¿╥σ╡─╝ⁿ ( ? ╧╘╩╛╦∙╙╨╡─╢¿╥σ): $'
- shkmsg2 db ' decimal is defined as',cr,lf,'$'
- cshkmsg2 db ' ╩«╜°╓╞╩²▒╗╢¿╥σ╬¬',cr,lf,'$'
- shkmsg3 db cr,lf,'... more, push any key to continue ...$'
- cshkmsg3 db cr,lf,'... ╗╣╙╨, ┤≥╚δ╚╬╥╗╝ⁿ╥╘╝╠╨°...$'
- kwarnmsg db cr,lf,' Notice: this form of Set Key is obsolete$'
- ckwarnmsg db cr,lf,' ╫ó╥Γ: ╒Γ╓╓╔Φ╓├╝ⁿ╡─╖╜╩╜╥╤▒╗╣²╩▒$'
-
- ascmsg db ' Ascii char: $'
- cascmsg db ' Ascii ╫╓╖√: $'
- scanmsg db ' Scan Code $'
- cscanmsg db ' ╔¿├Φ┬δ $'
- strngmsg db ' String: $'
- cstrngmsg db ' ╫╓╖√┤«: $'
- verbmsg db ' Verb: $'
- cverbmsg db ' ╢»╫≈: $'
- noxmsg db ' Self, no translation.$'
- cnoxmsg db ' ▒╛╥σ, ├╗╙╨╫¬╗╗.$'
- fremsg db cr,lf,' Free space: $'
- cfremsg db cr,lf,' ╫╘╙╔┐╒╝Σ: $'
- kyfrdef db ' key and $'
- ckyfrdef db ' ╝ⁿ ║═ $'
- stfrdef db ' string definitions, $'
- cstfrdef db ' ┤«╡─╢¿╥σ, $'
- stfrspc db ' string characters.',cr,lf,'$'
- cstfrspc db ' ┤«╡─╫╓╖√.',cr,lf,'$'
- ; translation tables
- keylist dw maxkeys dup (0) ; 16 bit keycodes, paralled by dirlist
- dirlist dw maxkeys dup (0) ; director {v+s} + {index | new char}
- sptable dw maxstng dup (0) ; list of asciiz string offsets
- stbuf dw stbuflen dup (0) ; buffer for strings
- strmax dw stbuf ; first free byte in stbuf
- listptr dw ? ; item number for keylist and dirlist
- nkeys dw 0 ; number of actively defined keys
- keycode dw ? ; ascii/scan code for key
- kbtemp dw ? ; scratch storage for translator
- brace db ? ; brace detected flag byte
- oldform db 0 ; old form Set Key, if non-zero
- verblen dw ? ; length of user's verb (work temp)
- kwcnt dw ? ; number of keywords (work temp)
- msutake db ? ; if being run from take file or not
- twelve dw 12d
- dosflg db 0
- ;;; End System Independent Data Area
-
- ;;; System Dependent Data Area
- ; edit dfhelp2 to include nice list of verbs for this system.
- dfhelp2 db cr,lf,' Enter either \Kverb for a Kermit action verb',cr,lf
- db ' or a replacement string (single byte binary numbers are'
- db ' \{b##})',cr,lf,' or push Return to undefine a key, ^C to'
- db ' retain current definition.'
- db cr,lf,' Braces {} are optional, and strings maybe enclosed in'
- db ' them.',cr,lf,' Strings may not begin with the character'
- db ' combinations of \k or \{k',cr,lf
- db ' (start with a { brace instead).',cr,lf,lf
- db ' Verbs are as follows. VT102 keys (arrows and keypad):',cr,lf
- db ' uparr, dnarr, lfarr, rtarr, kpminus, kpcoma, kpdot, kpenter,'
- db cr,lf
- db ' Gold (same as PF1), PF1, PF2, PF3, PF4, kp0, ... kp9'
- db cr,lf,' Kermit screen control and actions:',cr,lf
- db ' upscn, dnscn, homscn, endscn, upone, dnone, prtscn, dump,'
- db cr,lf
- db ' logoff, logon, termtype, reset, holdscrn, modeline, break,'
- db ' lbreak,'
- db cr,lf
- db ' hangup, null (send one), terminalR, terminalS, DOS, help,'
- db ' status, exit'
- db cr,lf,'$'
-
- ; Aliaskey: keys having aliases - same ascii code but more than one
- ; scan code, as on auxillary keypads. Use just scan codes with these.
- ; Alternative use: force ascii keys to report out just scan codes.
- ; Table format: high byte = scan code, low byte = ascii code.
- ; Contents are machine dependent.
- cdfhelp2 db cr,lf,' ╝ⁿ╚δ╫≈╬¬╥╗╕÷ Kermit ╢»╫≈╡─ \Kverb ',cr,lf
- db '╗≥╒▀ ╝ⁿ╚δ╥╗╕÷╠µ╗╗┤«(╡Ñ╫╓╜┌╢■╜°╓╞╩²╡─╕±╩╜╩╟ \{b##} )'
- db cr,lf,' ╗≥ ░┤ Return ╖┼╞·╝ⁿ╢¿╥σ, ░┤ ^C ▒ú┴⌠╝ⁿ╡─╡▒╟░╢¿╥σ.'
- db cr,lf,' { }▒φ╩╛╚╬╤í╧ε, ╫╓╖√┤«┐╔─▄╩╣╙├{ }.'
- db cr,lf,' ╫╓╖√┤«┐╔╥╘▓╗╙├╥╘ \K ╗≥ \{K ┐¬═╖╡─╫╓╖√╫Θ║╧',cr,lf
- db '(╢°┤·╥╘ { ┐¬═╖).',cr,lf,lf
- db ' ╙╨╧┬┴╨╢»┤╩┐╔╥╘╩╣╙├:'
- db cr,lf,' VT102 ╘╩╨φ╡─╝ⁿ(╖╜╧≥╝ⁿ║═╩²╫╓╨í╝ⁿ┼╠):',cr,lf
- db ' uparr, dnarr, lfarr, rtarr, kpminus, kpcoma, kpdot, kpenter,'
- db cr,lf
- db ' Gold (\3 PF1), PF1, PF2, PF3, PF4, kp0, ...kp9'
- db cr,lf,' Kermit ╞┴─╗┐╪╓╞╙δ▓┘╢»╫≈:',cr,lf
- db ' upscn, dnscn, homscn, endscn, upone, dnone, prtscn, dump,'
- db cr,lf
- db ' logoff, logon, termtype, reset, holdscrn, modeline, break,'
- db ' lbread,'
- db cr,lf
- db ' hangup, null (╖ó╦═╥╗╕÷), terminalR, terminalS, DOS, help,'
- db ' status, exit'
- db cr,lf,'$'
-
- ; Aliaskey: keys having aliases - same ascii code but more than one
- ; scan code, as on auxillary keypads. Use just scan codes with these.
- ; Alternative use: force ascii keys to report out just scan codes.
- ; Table format: high byte = scan code, low byte = ascii code.
- ; Contents are machine dependent.
- aliaskey dw (14*scan)+bs ; Backspace key [hi=scan, lo=ascii]
- dw (55*scan)+'*' ; keypad asterisk
- dw (74*scan)+'-' ; keypad minus
- dw (78*scan)+'+' ; keypad plus
- dw (71*scan)+'7' ; keypad numeric area
- dw (72*scan)+'8'
- dw (73*scan)+'9'
- dw (75*scan)+'4'
- dw (76*scan)+'5'
- dw (77*scan)+'6'
- dw (79*scan)+'1'
- dw (80*scan)+'2'
- dw (81*scan)+'3'
- dw (82*scan)+'0'
- dw (83*scan)+'.'
- dw (83*scan)+',' ; German keypad had comma vs dot
- dw (15*scan)+tab
- aliaslen equ ($-aliaskey) shr 1 ; number of words in aliaskey table
-
- kverbs db 48 ; number of table entries below
- mkeyw 'uparr',uparrw ; independent of ordering and case!
- mkeyw 'dnarr',dnarrw ; mkeyw 'name',procedure entry point
- mkeyw 'lfarr',lfarr
- mkeyw 'rtarr',rtarr
- mkeyw 'gold',pf1
- mkeyw 'pf1',pf1
- mkeyw 'pf2',pf2
- mkeyw 'pf3',pf3
- mkeyw 'pf4',pf4
- mkeyw 'kp0',kp0
- mkeyw 'kp1',kp1
- mkeyw 'kp2',kp2
- mkeyw 'kp3',kp3
- mkeyw 'kp4',kp4
- mkeyw 'kp5',kp5
- mkeyw 'kp6',kp6
- mkeyw 'kp7',kp7
- mkeyw 'kp8',kp8
- mkeyw 'kp9',kp9
- mkeyw 'kpminus',kpminus
- mkeyw 'kpcoma',kpcoma
- mkeyw 'kpenter',kpenter
- mkeyw 'kpdot',kpdot
- mkeyw 'termtype',vtans52
- mkeyw 'reset',vtinit
- mkeyw 'holdscrn',khold
- mkeyw 'dnscn',dnwpg
- mkeyw 'upscn',upwpg
- mkeyw 'endscn',endwnd
- mkeyw 'homscn',homwnd
- mkeyw 'upone',upone
- mkeyw 'dnone',dnone
- mkeyw 'prtscn',trnprs
- mkeyw 'dump',dmpscn
- mkeyw 'modeline',trnmod
- mkeyw 'break',sendbr
- mkeyw 'lbreak',sendbl
- mkeyw 'hangup',chang
- mkeyw 'null',snull
- mkeyw 'logon',klogon
- mkeyw 'logoff',klogof
- mkeyw 'terminalR',vtrmac
- mkeyw 'terminalS',vtsmac
- mkeyw 'DOS',cdos
- mkeyw 'help',cquery
- mkeyw 'status',cstatus
- mkeyw 'exit',cquit
-
- ; Initialization data.
- kbdinlst equ this byte ; Kermit IBM initialization time keyboard setup
- mkeyw '\kgold',scan+59 ; F1 mkeyw 'definition',keycode
- mkeyw '\kpf2',scan+60 ; F2
- mkeyw '\kpf3',scan+61 ; F3
- mkeyw '\kpf4',scan+62 ; F4
- mkeyw '\kkp0',scan+shift+90 ; VT100 keypad numeric area, SF7
- mkeyw '\kkp1',scan+shift+86 ; SF3
- mkeyw '\kkp2',scan+shift+87 ; SF4
- mkeyw '\kkp3',scan+shift+88 ; SF5
- mkeyw '\kkp4',scan+67 ; F9
- mkeyw '\kkp5',scan+68 ; F10
- mkeyw '\kkp6',scan+shift+84 ; SF1
- mkeyw '\kkp7',scan+63 ; F5
- mkeyw '\kkp8',scan+64 ; F6
- mkeyw '\kkp9',scan+65 ; F7
- mkeyw '\kkpenter',scan+shift+89 ; SF6
- mkeyw '\kkpcoma',scan+shift+85 ; SF2
- mkeyw '\kkpminus',scan+66 ; F8
- mkeyw '\kkpdot',scan+shift+91 ; SF8
- mkeyw '\kuparr',scan+72 ; VT100 cursor keys (arrows)
- mkeyw '\kdnarr',scan+80
- mkeyw '\klfarr',scan+75
- mkeyw '\krtarr',scan+77
- mkeyw '\kupscn',scan+73 ; PgUp Kermit screen roll back keys
- mkeyw '\kdnscn',scan+81 ; PgDn
- mkeyw '\khomscn',scan+71 ; Home
- mkeyw '\kendscn',scan+79 ; End
- mkeyw '\kupone',scan+control+132 ; Ctrl PgUp one line scrolls
- mkeyw '\kdnone',scan+control+118 ; Ctrl PgDn
- mkeyw '\kuparr',scan+enhanced+72 ; Enhanced kbd duplicate keys
- mkeyw '\kdnarr',scan+enhanced+80
- mkeyw '\klfarr',scan+enhanced+75
- mkeyw '\krtarr',scan+enhanced+77
- mkeyw '\kupscn',scan+enhanced+73 ; PgUp Kermit screen roll back keys
- mkeyw '\kdnscn',scan+enhanced+81 ; PgDn
- mkeyw '\khomscn',scan+enhanced+71 ; Home
- mkeyw '\kendscn',scan+enhanced+79 ; End
- mkeyw '\kupone',scan+control+enhanced+132 ;Ctrl PgUp one line scroll
- mkeyw '\kdnone',scan+control+enhanced+118 ; Ctrl PgDn
- mkeyw '\kmodeline',scan+74 ; Kermit toggle mode line Keypad -
- mkeyw '\ktermtype',scan+alt+130 ; Kermit toggle terminal type Alt -
- mkeyw '\kreset',scan+alt+131 ; Kermit reset terminal Alt =
- mkeyw '\kprtscn',scan+control+114 ; Kermit toggle prn scrn Ctrl *
- mkeyw '\kdump',scan+control+117 ; Kermit Dump Screen Ctrl End
- mkeyw '*',scan+55 ; keypad asterisk
- mkeyw '*',scan+enhanced+55 ; Enhanced kbd keypad asterisk
- ;;; mkeyw '-',scan+74 ; keypad minus
- mkeyw '+',scan+78 ; keypad plus
- mkeyw '.',scan+shift+83 ; IBM numeric keypad
- mkeyw '0',scan+shift+82
- mkeyw '1',scan+shift+79
- mkeyw '2',scan+shift+80
- mkeyw '3',scan+shift+81
- mkeyw '4',scan+shift+75
- mkeyw '5',scan+shift+76
- mkeyw '6',scan+shift+77
- mkeyw '7',scan+shift+71
- mkeyw '8',scan+shift+72
- mkeyw '9',scan+shift+73
- mkeyw tab,scan+15 ; regular Tab key, made special
- mkeyw cr,scan+enhanced+cr ; Enhanced kbd grey Enter key
- mkeyw lf,scan+enhanced+control+lf ; Enhanced grey Control Enter
- mkeyw '/',scan+enhanced+'/' ; Enhanced kbd grey foward slash
- mkeyw '\0',scan+control+3 ; Control at-sign sends null
- mkeyw '\0',scan+control+shift+3 ; Control Shift at-sign sends null
- mkeyw '\x7f',scan+83 ; Del key sends DEL
- mkeyw '\x7f',scan+enhanced+83 ; Enhanced duplicate DEL sends DEL
- mkeyw '\x7f',scan+14 ; Backspace key sends DEL
- mkeyw '\kexit',scan+alt+45 ; Exit connect mode Alt X
- mkeyw '\kstatus',scan+alt+31 ; Connect mode status Alt S
- mkeyw '\kbreak',scan+alt+48 ; Send a Break Alt B
- mkeyw '\kbreak',scan+control+0; Control-Break sends a Break too
- mkeyw '\khelp',scan+alt+35 ; Connect mode drop down menu Alt H
- dw 0 ; end of table marker
-
- datas ends
-